'This Program Replicates FIGURE 8 in "Should the Federal Reserve Regularly Evaluate its Monetary Policy Framework?"
'by Fuhrer, Olivei, Rosengren, and Tootell
'Note: You will need EViews (version 9 or later to run this program

'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Load Greenbook Series for Estimation

load c:\work\BPEA\GB\DATA_FIGURE_8_EViews.wf1

'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Kalman Filter Estimation for Equation 3 in the Text
' Note that in what follwos gamma_0 is alpha, gamma_ff_1 is beta, gamma_pi is gamma_1, and gamma_u is is gamma_2 


sspace ss1

ss1.append @state   alpha 			=	alpha(-1)																		+	[ename = e1]
ss1.append @state   beta 			=	beta(-1)																			+	[ename = e2]
ss1.append @state   gamma_1 	=	gamma_1(-1)																	+	[ename = e3]
ss1.append @state   gamma_2 	=	gamma_2(-1)																	+	[ename = e4]

ss1.append @state   eta				=	0																					+	[ename = e5]
ss1.append @state	  eta_l			=   eta(-1)	

ss1.append @signal  ffr 				=	beta*ffr(-1) 	+ 	(alpha 	+	gamma_1*pf4  	+ 	gamma_2*urf4)  		+ 	eta 	- c(1)*eta_l							

'C			0.2569384689897417	
'FFR(-1)	0.001283272907262939	
'PF4		0.006440230172017808	
'URF4	0.00964222182383875

'Maximum LR F-statistic (1980Q4)		11.37748		
'Exp LR F-statistic							1.880106		
'Ave LR F-statistic							1.663568	

'Sample: 	1968Q1 2007Q4	
'Included observations: 157	
'implied lambda from Ave LR F-statistic :	5
'implied lambda from Max LR F-statistic :	10

'tau	=	0.03185 	with lambda = 5
'tau	=	0.03185*2 	with lambda = 10

ss1.append @evar var(e1) 		= 	0.25694*(0.03185*2)^2
ss1.append @evar var(e2) 		= 	0.00128*(0.03185*2)^2
ss1.append @evar var(e3) 		=   0.00644*(0.03185*2)^2  
ss1.append @evar var(e4) 		= 	0.00964*(0.03185*2)^2

ss1.append @evar var(e5) 		= exp(c(20)+dummy_post85*c(21)+dummy_7985*c(22)+dummy_post96*c(23))    

c(1)	=	0.0

c(10)  = -5.0
c(11)  = -5.0
c(12)  = -5.0
c(13)  = -5.0
c(14)  = -5.0
c(15)  = -5.0

c(20)  =  1.0
c(21)  = -2.0
c(22)	=   0.0
c(23)	=   0.0

vector(6) svec0 
'svec0.fill  2.0 , 0.5 , 0.8, -0.8, 0.0, 0.0
svec0.fill  2.29,	0.678,	0.882,	-0.676,	0.589,	0.258
sym(6)    svar0
svar0.fill   	2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 1.0, 0.0, 1.0
ss1.append @mprior  svec0
ss1.append @vprior    svar0

'estimate
smpl 1969:1 2008:4
ss1.ml(showopts,m=10000,c=1e-4)
freeze(out1) ss1.output
show out1


